*******************
* All figures in Appendix A-C
*******************

*************************************************************************************************

clear all
set more off

set maxvar 32000
set matsize 11000

*set scheme aspen, perm
grstyle init
grstyle set plain, horizontal grid

use "$folder/data/data_ready.dta", clear
cd "$folder/output/figures"
local x=18

xtset state year, yearly delta(2)

*************** Figures A1- Lgraphs ***************

lgraph log_real1gsppc year, q(25 75) xtitle(Year) ytitle(Log GSP Per Capita)
graph export  Figure_A1A_gsppc_time.pdf, replace
lgraph log_provisions_18 year, q(25 75) xtitle(Year) ytitle(Log Provisions)
graph export  Figure_A1B_bprovisions_time.pdf, replace


*************** Figures A2 - Scatterplots of provisions against words or pages ***************

* Provisions on Words  - Using log values
scatter log_provisions_18 log_word_count_18, xtitle(Log Words) ytitle(Log Provisions) mfcolor(none) msize(small)
graph export Figure_A2A_Words_Provisions.pdf, replace

* Provisions on Pages - Using log values
scatter log_provisions_18 log_page, xtitle(Log Pages) ytitle(Log Provisions) mfcolor(none) msize(small)
graph export Figure_A2B_Pages_Provisions.pdf, replace


*************** Figures A3 - PCA Econ Sector Shares ***************
pca gsp_initial_*
screeplot
graph export Figure_A3_pcSectors.pdf, replace


**** Figures A4 - Binscatter Economic Policy Uncertainty ****

clear all
set more off

import excel "$folder/data/input/State_Policy_Uncertainty.xlsx", firstrow 
rename state state_abbrev

collapse(mean) EPU_Composite EPU_National EPU_State,by(state_abbrev year)

merge 1:1 state_abbrev year using "$folder/data/data_ready"
drop _merge


egen std_EPU_State=std(EPU_State)

egen std_state_news_uncertain=std(state_news_uncertain)

binscatter std_state_news_uncertain std_EPU_State, absorb(year) xtitle(EPU Baker et al.) ytitle(Our Economic Uncertainty Measure) text(0 -1 "Spearman rho = 0.41" , place(se) just(left) margin(l+4 t+1 b+1) width(25) ) xsize(8)
graph export Figure_A4_binscatt_EPU.pdf, replace


*************** Figures A6 - Time Series Plot***************
clear all
set more off

use "$folder/data/data_ready.dta"

preserve
keep if year>1964
keep if year<2012

collapse (mean)  error_rate share_amend_clause_count share_repeal_clause_count, by(year)

label variable share_amend_clause_count "Share Repeal Clauses"
label variable share_repeal_clause_count "Share Amend Clauses"
label variable error_rate "OCR Misspelling Rate"

twoway line  error_rate share_amend_clause_count share_repeal_clause_count year
graph export Figure_A6_time_amendrepeal_error.pdf, replace

restore

*************** Figures A8 & A10- Shares of policy categories ***************
use "$folder/data/data_ready.dta", clear

preserve

collapse (sum) provisions_42econ provisions_42soc provisions_42proc provisions_42fisc provisions_42 cond_list_42econ cond_list_42soc cond_list_42proc cond_list_42fisc cond_list_prov_42, by(year)

gen share_prov_econ = provisions_42econ/provisions_42
gen share_prov_soc = provisions_42soc/provisions_42
gen share_prov_proc = provisions_42proc/provisions_42
gen share_prov_fisc = provisions_42fisc/provisions_42

label variable share_prov_econ "Economic"
label variable share_prov_proc "Procedural"
label variable share_prov_soc "Social"
label variable share_prov_fisc "Fiscal"

twoway area share_prov_soc share_prov_proc share_prov_econ share_prov_fisc year, lpattern(solid solid solid solid) lcolor(blue cranberry ltblue purple) fcol(blue%30 cranberry%30 ltblue%30 purple%30) xsize(7) name(qq)
graph export Figure_A8_prov_share.pdf, replace

gen share_cont_econ = cond_list_42econ/provisions_42econ
gen share_cont_soc = cond_list_42soc/provisions_42soc
gen share_cont_proc = cond_list_42proc/provisions_42proc
gen share_cont_fisc = cond_list_42fisc/provisions_42fisc

label variable share_cont_econ "Economic"
label variable share_cont_proc "Procedural"
label variable share_cont_soc "Social"
label variable share_cont_fisc "Fiscal"

twoway area share_cont_soc share_cont_proc share_cont_econ share_cont_fisc year, lpattern(solid solid solid solid) lcolor(blue cranberry ltblue purple) fcol(blue%30 cranberry%30 ltblue%30 purple%30) xsize(7) name(hf)
graph export Figure_A10_cont_share.pdf, replace

restore
*************** Figures A9 - Graph Deciles***************

lgraph logX_diffcond_list_prov_18 year, q(25 75) xtitle(Year) ytitle(Log Diff Cont Non-Cont)
graph export  Figure_A9_dec.pdf, replace


*************** Figures A11 - Binscatter shift-share components***************


import delimited using "$folder/data/input/state_year_18_all_topics.csv", clear

rename conditional_list_provisions cond_list_prov
rename non_conditional_list_provisions non_cond_list_prov
rename contingent_provisions cont_prov
rename non_contingent_provision non_cont_prov
rename cond_provisions cond_prov
rename non_cond_provisions non_cond_prov

* Currently topics are vertical - must reshape into wide format
drop v1
reshape wide entitlement special_verb entitlement_verb permission permissive_modal neg obligation active_verb strict_modal constraint_value word_count conditional_count conditional conditional_list cond provision cont_prov cond_list_prov cond_prov non_cont_prov non_cond_list_prov non_cond_prov amend repeal, i(state year num_topics) j(topic)



* biennium includes stated year and previous year
gen biennium =  year + mod(year,2)
replace year = biennium

foreach x in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  {

egen constr_obl`x'=rowtotal(constraint_value`x' obligation`x'), missing
egen permis_entit`x'=rowtotal(permission`x' entitlement`x'), missing

}
drop constraint_value* obligation* entitlement* permission*


* Collapsing to biennium level

collapse (mean) provision* word_count* cont_prov* cond_list_prov* cond_prov* non_cont_prov* non_cond_list_prov* non_cond_prov* permis_entit* constr_obl* special_verb* permissive_modal* neg* active_verb* strict_modal* amend* repeal*, by(state year)

* Setting time series

egen statefe = group(state)
gen statename1 = state
drop state
gen state = statefe

tsset statefe year, delta(2)

* Crating local macros for all variable combinations and categories

local variables provision0 - permis_entit17

local provisions provision0 - provision17

local words word_count0 - word_count17

local cont_prov cont_prov0 - cont_prov17

local cond_list_prov cond_list_prov0 - cond_list_prov17

local cond_prov cond_prov0 - cond_prov17

local non_cont_prov non_cont_prov0 - non_cont_prov17

local non_cond_list_prov non_cond_list_prov0 - non_cond_list_prov17

local non_cond_prov non_cond_prov0 - 

* Replacing missing values with lags

foreach x of varlist `variables' {

replace `x' = L.`x' if missing(`x')
replace `x' = L2.`x' if missing(`x')
replace `x' = L3.`x' if missing(`x')
replace `x' = L4.`x' if missing(`x')
replace `x' = L5.`x' if missing(`x')
}

reshape long provision word_count cont_prov cond_list_prov cond_prov non_cond_list_prov non_cont_prov non_cond_prov, i(state year) j(topic_number)

***Shift Component

gen log_provision=log(1 + provision)
sort state topic_number year
by state topic_number: gen growth_18provision = log_provision - log_provision[_n-1]
bys year topic_number: egen grow_sum_18provision = sum(growth_18provision)
gen shift_component18=(grow_sum_18provision - growth_18provision)/49

***Share Component 

bys state: egen prov_total_init = sum(provision) if year<=1960
bys state topic: egen prov_init = sum(provision) if year <= 1960

gen share18_provision = prov_init / prov_total_init


sort state topic_number year
by state topic_number: gen topic_in1_prov = share18_provision[1] 
by state topic_number: gen topic_in2_prov = share18_provision[2] 
by state topic_number: gen topic_in3_prov = share18_provision[3] 
by state topic_number: gen topic_in4_prov = share18_provision[4] 
by state topic_number: gen topic_in5_prov = share18_provision[5] 
by state topic_number: gen topic_init_prov1 = (topic_in1_prov + topic_in2_prov +topic_in3_prov+topic_in4_prov+topic_in5_prov)/5

bys state topic_number: egen share_component18 = mean(share18_provision)

binscatter growth_18provision share_component18, legend(off) xtitle(Pre-Period Provision Share on Topic {it:k}) ytitle(Log Provisions on Topic {it:k}) reportreg text(.015 0.08 "Slope =  -.549**" "(s.e. = .117)", place(se) just(left) margin(l+4 t+1 b+1) width(25)) msymbol(Oh)
graph export Figure_A11B_binscatter_share_component.pdf, replace


binscatter growth_18provision shift_component18 if year>1965, legend(off) xtitle(Leave-one-out Provision Shifter on Topic {it:k}) ytitle(Log Provisions on Topic {it:k}) reportreg text(0.09 .15 "Slope =  .625**" "(s.e. = .030)", place(se) just(left) margin(l+4 t+1 b+1) width(25)) msymbol(Oh)
graph export Figure_A11A_binscatter_shift_component.pdf, replace

*************** Figures A12 - Instrument Relevance ***************

use "$folder/data/data_ready.dta", clear
cd "$folder/output/figures"
local x=18

xtset state year, yearly delta(2)

foreach x in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 {

eststo: reghdfe growth_18provision`x' growth_sum_18provision`x' log_provisions_18 , absorb(state) cluster(state)

}

coefplot (est1, mlabel("0.Land Use/Utilities")) (est2, mlabel("1.Technical")) (est3, mlabel("2.Health")) (est4, mlabel("3. Judicial")) (est5, mlabel("4. Roads/Infrastructures"))   (est6, mlabel("5.Fiscal")) (est7, mlabel("6. Taxation")) (est8, mlabel("7.Banking")) (est9, mlabel("8. Procurement"))  (est10, mlabel("9.Public Administration")) (est11, mlabel("10. Licenses")) (est12, mlabel("11. Schools")) (est13, mlabel("12. Children/Family"))  (est14, mlabel("13. Procedural")) (est15, mlabel("14. Legal")) (est16, mlabel("15. Pensions/Benefits"))  (est17, mlabel("16. Local Government"))  (est18, mlabel("17. Schools")) , keep(log_provisions_18) title(Tot Provisions in State across Topics) nokey  ci(95) ciopts( lpattern(shortdash_dot)) ylabel("") pstyle(p1) msymbol(Oh) msize(small)
graph save Figure_A12A_relevance.gph, replace

coefplot (est1, mlabel("0.Land Use/Utilities")) (est2, mlabel("1.Technical")) (est3, mlabel("2.Health")) (est4, mlabel("3. Judicial")) (est5, mlabel("4. Roads/Infrastructures"))   (est6, mlabel("5.Fiscal")) (est7, mlabel("6. Taxation")) (est8, mlabel("7.Banking")) (est9, mlabel("8. Procurement"))  (est10, mlabel("9.Public Administration")) (est11, mlabel("10. Licenses")) (est12, mlabel("11. Schools")) (est13, mlabel("12. Children/Family"))  (est14, mlabel("13. Procedural")) (est15, mlabel("14. Legal")) (est16, mlabel("15. Pensions/Benefits"))  (est17, mlabel("16. Local Government"))  (est18, mlabel("17. Schools")) , drop(log_provisions_18 _cons) title(Tot Provisions in Topic across States) nokey  ci(95) ciopts( lpattern(shortdash_dot)) ylabel("") pstyle(p1) msymbol(Oh) msize(small)
graph save Figure_A12B_relevance1.gph, replace

gr combine Figure_A12A_relevance.gph  Figure_A12B_relevance1.gph 
graph export Figure_A12_Relevance.pdf, replace


*************** Figures A13 - pre-treatment instruments***************
eststo clear

foreach x in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 {

eststo: reghdfe growth_pc topic_init_provision`x',  absorb(year) cluster(state)

}

coefplot (est1, mlabel("0.Land Use/Utilities")) (est2, mlabel("1.Technical")) (est3, mlabel("2.Health")) (est4, mlabel("3. Judicial")) (est5, mlabel("4. Roads/Infrastructures"))   (est6, mlabel("5.Fiscal")) (est7, mlabel("6. Taxation")) (est8, mlabel("7.Banking")) (est9, mlabel("8. Procurement"))  (est10, mlabel("9.Public Administration")) (est11, mlabel("10. Licenses")) (est12, mlabel("11. Schools")) (est13, mlabel("12. Children/Family"))  (est14, mlabel("13. Procedural")) (est15, mlabel("14. Legal")) (est16, mlabel("15. Pensions/Benefits"))  (est17, mlabel("16. Local Government"))  (est18, mlabel("17. Schools")) , drop(_cons) title(Pre-Trends) nokey xline(0, lcolor(gray) lpattern(dash)) ci(95) ciopts(lpattern(shortdash_dot)) ylabel("") pstyle(p1) msymbol(Oh) msize(small)

graph save Figure_A13_instrument_pre.gph, replace
graph export Figure_A13_instrument_pre.pdf, replace
eststo clear


*************** Figures A14 - binscatter-correct-rate-inst***************

binscatter correct_rate shock_prov18, absorb(year) controls(i.state) xtitle(Shock Log Provision) ytitle(1 - Mis-spelling Rate) note("State Year FE") msymbol(Oh)
graph export Figure_A14_binscatter_correct_rate_inst.pdf, replace


*************** Figures A15 - binscatt_rf_amend_w***************

binscatter log_share_repeal_clause_count shock_prov18, absorb(state) controls(i.year) xtitle(Shock to Legislative Detail) ytitle(Share of Repeal Clauses) text(-5.6 -.2 "Slope = -.125" "(s.e. = .191)" "F-stat =0.44" , place(se) just(left) margin(l+4 t+1 b+1) width(25) ) xsize(8) 
graph export Figure_A15B_binscatt_rf_repeal_w.pdf, replace

binscatter log_share_amend_clause_count shock_prov18, absorb(state) controls(i.year) xtitle(Shock to Legislative Detail) ytitle(Share of Amend Clauses) text(-3.65 -.2 "Slope = -.154" "(s.e. = .176)" "F-stat =0.77" , place(se) just(left) margin(l+4 t+1 b+1) width(25) ) xsize(8)
graph export Figure_A15A_binscatt_rf_amend_w.pdf, replace


*******************
* All tables in Appendix A-C
*******************

*****************************
* TABLE A2 Extended Summary Statistics
*****************************

*set scheme aspen, perm
grstyle init
grstyle set plain, horizontal grid

use "$folder/data/data_ready.dta", clear
cd "$folder/output/tables"
local x=18

xtset state year, yearly delta(2)

gen log_fed_reg =log(fed_reg)
label variable growth_gsp "Log Real GSP Growth"
label variable log_gsp_a "Log Real GSP"
label variable log_real1gsppc "Log Real GSP Per Capita"
label variable growth_pc "Log Real GSP Per Capita Growth"
label variable lestab_D "Growth Number Estabilishments"
label variable lprofits_mill_D "Log Establishment Profit Growth"
label variable lcbp_emp_D "Log Employment Growth"

label variable log_provisions_18 "Log Provisions"
label variable log_cond_list_prov_18 "Log Contingent Provisions" 
label variable log_non_cond_list_prov_18 "Log Non-Contingent Provisions" 
label variable shock_prov18 "Shock to Provisions"
label variable shock_cond_list_prov18 "Shock to Contingent Provisions"
label variable shock_non_cond_list_prov18 "Shock to Non-Contingent Provisions"

label variable gsp_initial "Initial Gross State Product"
label variable growth_initial "Initial GSP Growth"
label variable gsp_pc_initial "Initial GSP per capita"
label variable log_fed_reg "Log Federal Regulation"

preserve
keep log_real1gsppc log_gsp_a growth_pc growth_gsp lcbp_emp_D lprofits_mill_D lestab_D
outreg2 using Table_A2_Outcomes, excel replace  sum(log) label 
restore

preserve
keep log_provisions_`x' log_cond_list_prov_`x' log_non_cond_list_prov_`x'  shock_prov`x' shock_cond_list_prov`x' shock_non_cond_list_prov`x'
outreg2 using Table_A2_Laws1, excel replace  sum(log) label 
restore

preserve
gen log_state_news_uncertain=log(state_news_uncertain)
gen log_real1taxpc=log(real1taxpc)
gen log_real1genexppc=log(real1genexppc)

label variable lpop "Log Population"
label variable loginc "Log Income"
label variable logexp "Log Expenses"
label variable loglegexp "Log Legislative Expenses"
label variable dem_control "Democratic Control"
label variable log_real1taxpc "Log Real Tax Per Capita"
label variable log_real1genexppc "Log Real General Exp p. Capita"
label variable urban "Urban Population"
label variable log_state_news_uncertain "Log State News Uncertainty"

keep lpop urban  dem_control  loginc  logexp   loglegexp   log_real1taxpc log_real1genexppc log_state_news_uncertain 
outreg2 using Table_A2_Covariates, excel replace  sum(log) label 
restore

preserve
keep log_fed_reg  
outreg2 using Table_A2_reg_courts, excel replace  sum(log) label 
restore


gen log_donations = log(donations)

label variable log_word_count_courts "Log State Court Opinion Words"
label variable log_word_count_reg "Log State Regulation Words"
label variable log_share_amend_clause_count "Log Share Amend Sentences"
label variable log_share_repeal_clause_count "Log Share Repeal Sentences"
label variable error_rate "Log Statute Misspelling Rate"
label variable log_word_count_18 "Log State Statute Words"
label variable log_donations "Log Campaign Contributions"
label variable contributionslimit "Campaign Finance Regulation"
label variable log_word_count_reg "Log State Regulation Words"
label variable log_share_amend_clause_count "Log Share Amend Sentences"
label variable log_share_repeal_clause_count "Log Share Repeal Sentences"
label variable error_rate "Log Statute Misspelling Rate"
label variable log_word_count_18 "Log State Statute Words"


preserve
keep log_word_count_courts 
outreg2 using Table_A2_reg_courts3, excel replace  sum(log) label 
restore

preserve
keep log_word_count_reg
outreg2 using Table_A2_reg_courts2, excel replace  sum(log) label 
restore

preserve
keep log_word_count_18 log_share_amend_clause_count log_share_repeal_clause_count error_rate
outreg2 using Table_A2_Laws2, excel replace  sum(log) label 
restore

preserve
keep log_donations
outreg2 using Table_A2_Covariates2, excel replace sum(log) label 
restore

preserve
keep contributionslimit 
outreg2 using Table_A2_Covariates3, excel append  sum(log) label 
restore

preserve
keep log_word_count_reg
outreg2 using Table_A2_reg_courts2, excel replace  sum(log) label 
restore

preserve
keep log_word_count_18 log_share_amend_clause_count log_share_repeal_clause_count error_rate
outreg2 using Table_A2_Laws2, excel replace  sum(log) label 
restore


*************** Table A.3: Summary Statistics Relationship Specificity***************
clear all

use "$folder/data/sector-econ1997.dta", clear

append using "$folder/data/sector-econ1963.dta" 

cd "$folder/output/tables"

drop if year==.

drop industry_sic  sector_spec frac_lib_not_homog2 frac_lib_diff2 frac_lib_diff

collapse (mean) gsp frac_lib_not_homog , by( industry_naics)

egen gsp_tot = sum(gsp)

gen gsp_share= gsp/gsp_tot

gen gsp_share_pc = gsp_share*100

sort frac_lib_not_homog

outsheet gsp_share_pc frac_lib_not_homog industry_naics using Table_A3_sectorspec.csv, comma replace

*************** Table A.4: Summary Statistics on Statute Segmentation***************
use "$folder/data/data_ready", clear

cd "$folder/output/tables"

grstyle init
grstyle set plain, horizontal grid

preserve

bys year state: egen statutes_mean = mean(statutes)

graph bar (sum) statutes if year<2014, over(year, gap(0) label(angle(45))) ytitle(Number of Statutes) inten(20) bar(1, color(ltblue) lcolor(navy)) 
graph export Table_A4A_statutes_year.pdf, replace
graph bar (mean) statutes_mean if year<2014, over(year, gap(0) label(angle(45) labs(vsmall))) ytitle(Average Statutes per State) inten(20) bar(1, color(ltblue) lcolor(navy)) 
graph export Table_A4C_statutes_per_state_year.pdf, replace
graph bar (mean) word_statute_m if year<2014, over(year, gap(0) label(angle(45) labs(vsmall))) ytitle(Average Word per Statute) inten(20) bar(1, color(ltblue) lcolor(navy)) 
graph export Table_A4D_word_per_statute_year.pdf, replace

grstyle init
grstyle set plain

gen log_word_statute = log( word_statute_m)
hist log_word_statute , color(ltblue) lcolor(navy) xtitle(Distribution of Log Word Counts per Statute)

graph export Table_A4B_word_per_statute.pdf, replace

restore

*************** Table A.9: Descriptive Statistics on Contingency, by Decade***************
gen decade="1960s" 
replace decade = "1970s" if decade70==1
replace decade = "1980s" if decade80==1
replace decade = "1990s" if decade90==1
replace decade = "2000s" if decade00==1

eststo clear

sort decade

by decade: eststo: quietly estpost summarize logX_diffcond_list_prov_18, listwise

esttab using Table_A9_descr_year_cont_diff.txt, replace cells("mean sd") label nodepvar 

eststo clear

by decade: eststo: quietly estpost summarize log_cond_list_prov_18 log_non_cond_list_prov_18, listwise

esttab using Table_A9_descr_year_cont.txt, replace cells("mean sd") label nodepvar

gen share_cont= cond_list_prov_18/ provisions_18

eststo clear

by decade: eststo: quietly estpost summarize share_cont, listwise

esttab using Table_A9_descr_year_cont_share.txt, replace cells("mean sd") label nodepvar


*************** Table A.10: Descriptive Statistics on Endogenous Regressor and Instrument, by Decade***************
eststo clear

sort decade

by decade: eststo: quietly estpost summarize shock_prov18 log_provisions_18, listwise

esttab using Table_A10_descr_year, replace cells("mean sd") label nodepvar 

*************** Table A.11: First Stage Estimates are Stable Over Time***************

gen decade6070=0
replace decade6070=1 if year<1980 & year>1958
gen decade8090=0
replace decade8090=1 if year<2000 & year>1978

reghdfe log_provisions_18 shock_prov18  if decade6070==1, absorb(state year) cluster(state)
outreg2 using Table_A11_FirstStageDecade, excel replace label   ctitle(60s70s)  keep(shock_prov18) nocons addtext(State FE, X, Time FE, X) alpha(0.01, 0.05, 0.1) symbol(**, *, +)  nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1)
reghdfe log_provisions_18 shock_prov18 if decade8090==1, absorb(state year) cluster(state)
outreg2 using Table_A11_FirstStageDecade, excel append label   ctitle(80s90s)  keep(shock_prov18) nocons addtext(State FE, X, Time FE, X) alpha(0.01, 0.05, 0.1) symbol(**, *, +)  nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1)
reghdfe log_provisions_18 shock_prov18 if decade00==1, absorb(state year) cluster(state)
outreg2 using Table_A11_FirstStageDecade, excel append label   ctitle(00s)  keep(shock_prov18) nocons addtext(State FE, X, Time FE, X) alpha(0.01, 0.05, 0.1) symbol(**, *, +)  nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1)



***************Table A.12: Placebo Test: No Lead Effect of Legislative Output on Economic Growth***************
xtset state year, yearly delta(2)

*OLS
reghdfe growth_pc F_log_provisions_18, absorb(state##c.year year) cl(state)
outreg2 using Table_A12_Placebo, excel replace nocons label   ctitle(OLS)    addtext(State FE, X, Time FE, X, State-Specific Trends, X)    alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) 

*RF
reghdfe growth_pc F.shock_prov18, absorb(state##c.year year) cl(state)
outreg2 using Table_A12_Placebo, excel append nocons label   ctitle(RF)    addtext(State FE, X, Time FE, X, State-Specific Trends, X)    alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) 

*2SLS
ivreghdfe growth_pc (F_log_provisions_18 = F.shock_prov18) , absorb(state##c.year year) cl(state)
outreg2 using Table_A12_Placebo, excel append nocons label   ctitle(2SLS)    addtext(State FE, X, Time FE, X, State-Specific Trends, X)   addstat(First Stage F-stat, e(rkf)) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) 




***************Table A.13: Instrument Uncorrelated with Initial Characteristics***************

label var initial_urban "Initial Share of Urban Pop"
label var initial_foreign "Initial Share of Foreign Pop"
label var initial_lpop "Initial Log Population"
label var initial_lpop2 "Initial Log Population^2"
label var gsp_pc_initial "Initial Growth per Capita"

bys state: egen init_year=min(year)
gen init_year10=init_year+20

*Balance Tests I

reghdfe shock_prov18 initial_urban initial_foreign initial_lpop initial_lpop2,  absorb(year) cluster(state)
outreg2 using Table_A13_bal, excel replace label   ctitle(Instrument)    addtext(Time FE, X, Sample Years, All) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) nocons

reghdfe shock_prov18 initial_urban initial_foreign initial_lpop initial_lpop2 if year <=init_year10,  absorb(year) cluster(state)
outreg2 using Table_A13_bal, excel append label   ctitle(Instrument)    addtext(Time FE, X, Sample Years, First Ten) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) nocons

reghdfe shock_prov18  gsp_pc_initial,  absorb(year) cluster(state)
outreg2 using Table_A13_bal, excel append label   ctitle(Instrument)    addtext(Time FE, X, Sample Years, All) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1)  nocons
reghdfe shock_prov18  gsp_pc_initial if year<=init_year10,  absorb(year) cluster(state)
outreg2 using Table_A13_bal, excel append label   ctitle(Instrument)    addtext(Time FE, X, Sample Years, First Ten ) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) nocons
 

*Balance Tests II

reghdfe pc1_compl18  gsp_pc_initial if year==init_year,  absorb(year) cluster(state)
outreg2 using Table_A13_bal, excel append label ctitle(PCA)    addtext(Time FE, X , Sample Years, First) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) nocons

reghdfe pc1_compl18 initial_urban initial_foreign initial_lpop initial_lpop2 if year==init_year,  absorb(year) cluster(state)
outreg2 using Table_A13_bal, excel append label ctitle(PCA)    addtext(Time FE, X, Sample Years, First) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) nocons

***************Table A.14: Instrument Balance Checks for Potential Confounders***************
gen log_real1taxpc = log(real1taxpc)
gen log_real1genexppc = log(real1genexppc)

* General Spending
reghdfe log_real1genexppc shock_prov18, absorb(state year) cl(state)
outreg2 using Table_A14_Instrument_Balance, excel replace label ctitle(Gen Exp) nocons addtext(Time FE, X) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) 
reghdfe L.log_real1genexppc shock_prov18, absorb(state year) cl(state)
outreg2 using Table_A14_Instrument_Balance, excel append label ctitle(Lag Gen Exp) nocons addtext(Time FE, X) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) 

* Legislative Spending
reghdfe loglegexp shock_prov18, absorb(state year) cl(state)
outreg2 using Table_A14_Instrument_Balance, excel append label ctitle(Leg Exp) nocons addtext(Time FE, X) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) 
reghdfe L.loglegexp shock_prov18, absorb(state year) cl(state)
outreg2 using Table_A14_Instrument_Balance, excel append label ctitle(Lag Leg Exp) nocons addtext(Time FE, X) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) 

* Taxation per capita
reghdfe log_real1taxpc shock_prov18, absorb(state year) cl(state)
outreg2 using Table_A14_Instrument_Balance, excel append label ctitle(Tax) nocons addtext(Time FE, X) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) 
reghdfe L.log_real1taxpc shock_prov18, absorb(state year) cl(state)
outreg2 using Table_A14_Instrument_Balance, excel append label ctitle(Lag Tax) nocons addtext(Time FE, X) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) 

* Political party 
reghdfe dem_control shock_prov18, absorb(state year) cl(state)
outreg2 using Table_A14_Instrument_Balance, excel append label ctitle(Party) nocons addtext(Time FE, X) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) 

reghdfe L.dem_control shock_prov18, absorb(state year) cl(state)
outreg2 using Table_A14_Instrument_Balance, excel append label ctitle(Lag Party) nocons addtext(Time FE, X) alpha(0.01, 0.05, 0.1) symbol(**, *, +) nor2 nonotes addnote(SE clustered by `e(clustvar)', **p<.01; *p<.05; +p<.1) 
 


